package com.usian.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope  //全局刷新    配置中心内容一旦修改   自动加载覆盖
public class ConfigController {
    @Value("${config.name}")
    private String configName;

    @RequestMapping("/config")
    public String config(){
        return configName;
    }
}
